<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The parallel\Events class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="parallel-channel.close.html">« parallel\Channel::close</a></li>
      <li style="float: right;"><a href="parallel-events.setblocking.html">parallel\Events::setBlocking »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.parallel.html">parallel</a></li>
    <li>The parallel\Events class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.parallel-events" class="reference">

 <h1 class="title">The parallel\Events class</h1>
 

 <div class="partintro"><p class="verinfo">(0.9.0)</p>
  <div class="section">
    <h2 class="title">The Event Loop</h2>
    <p class="para">
     The Event loop monitors the state of sets of futures and or channels (targets) in order to perform read (<span class="methodname"><a href="parallel-future.value.html" class="methodname">parallel\Future::value()</a></span>, <span class="methodname"><a href="parallel-channel.recv.html" class="methodname">parallel\Channel::recv()</a></span>) and write (<span class="methodname"><a href="parallel-channel.send.html" class="methodname">parallel\Channel::send()</a></span>) operations as the targets become available and the operations may be performed without blocking the event loop.
    </p>
  </div>
  <div class="section" id="parallel-events.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">final</span>
      <span class="modifier">class</span> <strong class="classname">parallel\Events</strong>
     </span>
     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.countable.html" class="interfacename">Countable</a></span><span class="oointerface">,  <a href="class.traversable.html" class="interfacename">Traversable</a></span> {</div>

   
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Input */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="parallel-events.setinput.html" class="methodname">setInput</a></span>(<span class="methodparam"><span class="type"><span class="type Input">Input</span></span> <code class="parameter">$input</code></span>): <span class="type"><span class="type void">void</span></span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Targets */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-events.addchannel.html" class="methodname">addChannel</a></span>(<span class="methodparam"><span class="type"><a href="class.parallel-channel.html" class="type parallel\Channel">parallel\Channel</a></span> <code class="parameter">$channel</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-events.addfuture.html" class="methodname">addFuture</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="class.parallel-future.html" class="type parallel\Future">parallel\Future</a></span> <code class="parameter">$future</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-events.remove.html" class="methodname">remove</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$target</code></span>): <span class="type"><span class="type void">void</span></span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Behaviour */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-events.setblocking.html" class="methodname">setBlocking</a></span>(<span class="methodparam"><span class="type">bool</span> <code class="parameter">$blocking</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-events.settimeout.html" class="methodname">setTimeout</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$timeout</code></span>): <span class="type"><span class="type void">void</span></span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Polling */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-events.poll.html" class="methodname">poll</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.parallel-events-event.html" class="type parallel\Events\Event">parallel\Events\Event</a></span></span></div>

   }</div>


  </div>

 </div>

  






  






  






  






  






  






  







<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="parallel-events.setblocking.html">parallel\Events::setBlocking</a> — Behaviour</li><li><a href="parallel-events.settimeout.html">parallel\Events::setTimeout</a> — Behaviour</li><li><a href="parallel-events.setinput.html">parallel\Events::setInput</a> — Input</li><li><a href="parallel-events.addchannel.html">parallel\Events::addChannel</a> — Targets</li><li><a href="parallel-events.addfuture.html">parallel\Events::addFuture</a> — Targets</li><li><a href="parallel-events.remove.html">parallel\Events::remove</a> — Targets</li><li><a href="parallel-events.poll.html">parallel\Events::poll</a> — Polling</li></ul>
</div>
</div></div></body></html>